/*
 * Copyright (c) 2014. kupat Corporation. All rights reserved.
 *  see statement on http://www.kupat.cn.
 */
package com.kfgj.hkp.common.dataaccess;



import com.kfgj.hkp.common.BaseEntity;

import java.io.Serializable;
import java.util.List;

/**
 * Created by liwensihan on 2014/11/5.
 *
 * @author liwensihan
 */
public interface IBaseDao<T extends BaseEntity, PK extends Serializable> {

    int insert(T entity);

    int batchInsert(List<T> entities);

    int update(T entity);

    int batchUpdate(List<T> entities);

    int deleteById(PK id);

    int batchDeleteByIds(List<PK> id);

    T selectById(PK id);

    List<T> selectAll();

    List<T> selectAll(String orderBy, boolean isAsc);

    int updateByNativeSql(String sql);

    List<T> selectByNativeSql(String sql);

    T selectOneByNativeSql(String sql);

    int countByNativeSql(String sql);

}
